package thread1;

public class Demo3 {
    public static void main(String[] args) {

        Thread t1 = new Thread() {
            @Override
            public void run(){
                System.out.println("继承Thread，重写run，使用匿名内部类");
            }
        };


        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                System.out.println("实现Runnable，重写run，使用匿名内部类");
            }
        };
        Thread t2 = new Thread(runnable);


        Thread t3 = new Thread(() -> {
            System.out.println("lambda表达式");
        });


        t1.start();
        t2.start();
        t3.start();
    }
}
